package com.hua.api.modules.home.dao;

import com.hua.api.core.framework.statement.EntityManagerTemplate;
import com.hua.api.core.framework.statement.Statement;
import com.hua.api.core.framework.statement.mysql.StatementFactoryImpl;
import com.hua.api.modules.home.domain.OpenClient;
import org.springframework.stereotype.Repository;

@Repository("openClientDao")
public class OpenClientDao extends EntityManagerTemplate {

    public OpenClient findOpenClientUseAppkey(String appkey){
        Statement statement = StatementFactoryImpl.getInstance().createStatement("from  OpenClient o where o.appKey=?1");
        statement.addParam(appkey);
        return findObject(statement,OpenClient.class);
    }

}
